package com.example.LibrarySystem.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

@TableName("books")
public class Book {
    /**
     * mybatisplus id自增注解 不加 添加数据时 id会随机
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private String name;
    private String isbn;
    private String author;
    private Integer pages;
    private String pressName;
    private Integer bookClassId;
    private Date pdate;
    private String version;
    private String description;
    private String imgUrl;
    private Double price;

    public Book() {
    }

    public Book(Integer id, String name, String isbn, String author, Integer pages, String pressName, Integer bookClassId, Date pdate, String version, String description, String imgUrl, Double price) {
        this.id = id;
        this.name = name;
        this.isbn = isbn;
        this.author = author;
        this.pages = pages;
        this.pressName = pressName;
        this.bookClassId = bookClassId;
        this.pdate = pdate;
        this.version = version;
        this.description = description;
        this.imgUrl = imgUrl;
        this.price = price;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Integer getPages() {
        return pages;
    }

    public void setPages(Integer pages) {
        this.pages = pages;
    }

    public String getPressName() {
        return pressName;
    }

    public void setPressName(String pressName) {
        this.pressName = pressName;
    }

    public Integer getBookClassId() {
        return bookClassId;
    }

    public void setBookClassId(Integer bookClassId) {
        this.bookClassId = bookClassId;
    }

    public Date getPdate() {
        return pdate;
    }

    public void setPdate(Date pdate) {
        this.pdate = pdate;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Book{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", isbn='" + isbn + '\'' +
                ", author='" + author + '\'' +
                ", pages=" + pages +
                ", pressName='" + pressName + '\'' +
                ", bookClassId=" + bookClassId +
                ", pdate=" + pdate +
                ", version='" + version + '\'' +
                ", description='" + description + '\'' +
                ", imgUrl='" + imgUrl + '\'' +
                ", price=" + price +
                '}';
    }
}
